<template>
	<view class="">
		<!--文章列表-->

        <view class="hlbblock30" v-for="(item, index) in listData" @click="gotoPageFunc(item)">
            <view class="fsc">
                <block v-if="itemData.style.display==10">
                    <view style="width: 70%">
                        <view style="color: #6E6564;font-size: 32rpx">
                            {{ item.article_title }}
                        </view>
                        <view style="color: #999999;font-size: 24rpx">
                            {{ item.dec }}
                        </view>
                    </view>
                    <view style="width: 30%">
                        <image :src="item.image.file_path" style="width: 200rpx;height: 150rpx;border-radius: 12rpx" mode="aspectFill"></image>
                    </view>
                </block>
                <block v-else>
                    <view style="width: 100%">
                        <view style="color: #6E6564;font-size: 32rpx">
                            {{ item.article_title }}
                        </view>
                        <view style="color: #999999;font-size: 24rpx">
                            {{ item.dec }}
                        </view>
                    </view>
                </block>
            </view>
            <view class="fsc" style="margin-top: 20rpx">
                <view style="color: #999999;font-size: 24rpx">
                    阅读量:{{ item.actual_views }}
                </view>
                <view style="color: #999999;font-size: 24rpx">
                    {{ item.create_time }}
                </view>

            </view>

        </view>


<!--
		<view class="article-item" v-for="(item, index) in listData" :class="'show-type__'+ itemData.style.display" :key="index"
		 @click="gotoPageFunc(item)">
			&lt;!&ndash; 有图模式 &ndash;&gt;
			<template v-if="itemData.style.display == 10">
				<view class="d-b-c d-stretch d-c flex-1">
					<view class="">
						<view class="text-ellipsis f32">
							{{ item.article_title }}
						</view>
						<view class="des text-ellipsis mt10 f24 gray6">
							{{ item.dec }}
						</view>
					</view>
					<view class="d-s-c gray9 f26">
						<text>{{ item.create_time }}</text>
						<text class="ml30">阅读量:</text>
						<text class="ml10">{{ item.actual_views }}</text>
					</view>
				</view>
				<view class="picture ml20" v-if="item.image!=null&&item.image.file_path!=''">
					<image :src="item.image.file_path" mode="aspectFill"></image>
				</view>
			</template>
			&lt;!&ndash; 无图模式&ndash;&gt;
			<template v-if="itemData.style.display == 20">
				<view class="f32 text-ellipsis lh200">
					{{ item.article_title }}
				</view>
			</template>
		</view>-->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				/*数据列表*/
				listData: []
			};
		},
		props: ['itemData'],
		created() {
			this.listData = this.itemData.data;
		},
		methods: {
			/*跳转页面*/
			gotoPageFunc(e) {
				let url = 'pagesArticle/article/detail/detail?article_id=' + e.article_id;
				this.gotoPage(url);
			}
		}
	};
</script>

<style>
	.diy-article {
		background: #ffffff;
		margin: 20rpx;
		border-radius: 12rpx;
	}

	.diy-article .show-type__10,
	.diy-article .show-type__20 {
		display: flex;
		padding: 30rpx;
		border-bottom: 1rpx solid #D9D9D9;
	}

	.diy-article .show-type__10 .picture {
		width: 210rpx;
		height: 140rpx;
		border-radius: 12rpx;

	}

	.diy-article .show-type__10 .title {
		height: 80rpx;
	}

	.diy-article .show-type__10 .des {
		height: 36rpx;
	}

	.diy-article image {
		width: 100%;
		height: 100%;
		border-radius: 12rpx;
	}
</style>
